fin = open("../data/user_info.txt")
fout = open("../data/user_info_reduced.txt", "w")

label_dic = {}
pre10 = 0
for line in fin:
	line = line.strip()
	line_list = line.split("\t" or " ")
	labels = line_list[1].split("/")
	for l in labels:
		if int(l) not in label_dic:
			label_dic[int(l)] = 1
		else:
			label_dic[int(l)] = label_dic[int(l)] + 1
label_list = label_dic.items()
print label_list
label_list = sorted(label_list, key = lambda pair : pair[1], reverse = True)
print label_list
